:: [a] -> [a] -> Bool package:base-prelude

The isSubsequenceOf function takes two lists and returns True if all the elements of the first list occur, in order, in the second. The elements do not have to occur consecutively. isSubsequenceOf x y is equivalent to elem x (subsequences y).

Examples

>>> isSubsequenceOf "GHC" "The Glorious Haskell Compiler"
True

>>> isSubsequenceOf ['a','d'..'z'] ['a'..'z']
True

>>> isSubsequenceOf [1..10] [10,9..0]
False
The isInfixOf function takes two lists and returns True iff the first list is contained, wholly and intact, anywhere within the second.
>>> isInfixOf "Haskell" "I really like Haskell."
True
>>> isInfixOf "Ial" "I really like Haskell."
False
The isSuffixOf function takes two lists and returns True iff the first list is a suffix of the second. The second list must be finite.
>>> "ld!" `isSuffixOf` "Hello World!"
True
>>> "World" `isSuffixOf` "Hello World!"
False
The isPrefixOf function takes two lists and returns True iff the first list is a prefix of the second.
>>> "Hello" `isPrefixOf` "Hello World!"
True
>>> "Hello" `isPrefixOf` "Wello Horld!"
False